home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Fonts
- BackColor = &H00FFFFFF&
- Caption = "Fonts"
- ClientHeight = 3390
- ClientLeft = 1170
- ClientTop = 1545
- ClientWidth = 3840
- Height = 3795
- Icon = FONTS.FRX:0000
- Left = 1110
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 3390
- ScaleWidth = 3840
- Top = 1200
- Width = 3960
- Begin OptionButton Opt_Bold
- Caption = "Bold"
- Height = 255
- Left = 240
- TabIndex = 5
- Top = 3000
- Width = 1215
- End
- Begin CommandButton Cmd_End
- Caption = "&End"
- Height = 375
- Left = 2520
- TabIndex = 6
- Top = 2880
- Width = 1095
- End
- Begin OptionButton Opt_Ital
- Caption = "Italic"
- Height = 255
- Left = 240
- TabIndex = 4
- Top = 2700
- Width = 1215
- End
- Begin CommandButton Cmd_Prt
- Caption = "&Print List"
- Height = 375
- Left = 2520
- TabIndex = 3
- Top = 2400
- Width = 1095
- End
- Begin OptionButton Opt_Norm
- Caption = "Normal"
- Height = 255
- Left = 240
- TabIndex = 7
- Top = 2400
- Width = 1215
- End
- Begin PictureBox Pict_Font
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Left = 240
- ScaleHeight = 585
- ScaleWidth = 3345
- TabIndex = 1
- Top = 1680
- Width = 3375
- End
- Begin ListBox Lst_Size
- Height = 1395
- Left = 2880
- TabIndex = 2
- Top = 120
- Width = 855
- End
- Begin ListBox Lst_Face
- Height = 1395
- Left = 240
- Sorted = -1 'True
- TabIndex = 0
- Top = 120
- Width = 2295
- End
- ' FontView v1.0 by Charles K. Snider 10/91
- ' Send any and all comments to: Compuserve 73730,1315
- ' Declare variables
- Dim FaceName As String
- Sub Cmd_End_Click ()
- ' End program
- End
- End Sub
- Sub Cmd_Prt_Click ()
- ' Print routine
- ' Set Error trap - go to sub CheckError if detected
- On Error GoTo CheckError:
- ' Change mouse cursor to hourglass
- Fonts.MousePointer = 11
- ' Print header
- Header$ = "Available Screen Fonts"
- Printer.Print Header$ + Chr$(13) + Chr$(10)
- ' Get screen fonts and send list to printer
- For K% = 0 To Screen.FontCount - 1
- FontName = Screen.Fonts(K%)
- Printer.Print Screen.Fonts(K%)
- Next K%
- ' Restore font to default
- FontName = Screen.Fonts(0)
- ' Print number of available fonts
- Printer.Print Chr$(13) + Chr$(10) + "Number Of Fonts: "; Screen.FontCount
- ' End printing
- Printer.EndDoc
- ' restore cursor to default
- Fonts.MousePointer = 0
- ' avoid executing error handler if error occurs ("exit")
- Exit Sub
- ' branch here if error occurs
- CheckError:
- ' display error message
- MsgBox Error$(482), 16
- End Sub
- Sub Form_Click ()
- ' Display "About Box"
- Msg$ = "Font Viewer by Charles Snider" + Chr$(13) + Chr$(10) + "Compuserve 73730,1315"
- MsgBox Msg$, 64, "Font Viewer v1.0"
- End Sub
- Sub Form_Load ()
- ' Center on screen
- Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
- ' Get list of screen fonts and add to list box
- For I% = 0 To Screen.FontCount - 1
- FontName = Screen.Fonts(I%)
- Lst_Face.AddItem Screen.Fonts(I%)
- Next I%
- ' restore screen font to default
- FontName = Screen.Fonts(0)
- ' select first item in list box
- Lst_Face.ListIndex = 0
- ' Add list of font sizes to list box
- For J% = 6 To 30 Step 2
- Lst_Size.AddItem Str$(J%)
- Next J%
- ' Select fourth item is list box
- Lst_Size.ListIndex = 3
- ' Select normal font characteristic (TRUE)
- Opt_Norm.Value = -1
- End Sub
- Sub Form_Paint ()
- ' Repaint picture box after covered by another window
- ' This may also be accomplished by setting AutoDraw = True
- Pict_Font.Cls
- Pict_Font.Print ; FaceName$
- End Sub
- Sub Form_Resize ()
- ' Repaint picture when form is resized
- Pict_Font.Cls
- Pict_Font.Print ; FaceName$
- End Sub
- Sub Lst_Face_Click ()
- ' Display selected font
- ' Clear picure box
- Pict_Font.Cls
- ' Set variable to item chosen in list box
- FaceName$ = Lst_Face.List(Lst_Face.ListIndex)
- ' Change picture font to one chosen
- Pict_Font.FontName = FaceName$
- ' Display it
- Pict_Font.Print ; FaceName$
- End Sub
- Sub Lst_Size_Click ()
- ' Display font in selected size
- ' Clear picure box
- Pict_Font.Cls
- ' set variable to item chosen in list box
- FaceSize = Val(Lst_Size.List(Lst_Size.ListIndex))
- ' Change font size to one chosen
- Pict_Font.FontSize = FaceSize
- ' Display it
- Pict_Font.Print ; FaceName$
- End Sub
- Sub Opt_Bold_Click ()
- ' When Bold is chosen
- ' Set font attribute to Bold (TRUE) and turn Italic off (FALSE)
- Pict_Font.FontBold = -1
- Pict_Font.FontItalic = 0
- ' Clear picture box
- Pict_Font.Cls
- ' Display it
- Pict_Font.Print ; FaceName$
- End Sub
- Sub Opt_Ital_Click ()
- ' When Italic is chosen
- ' Set font attribute to italic (TRUE) and turn "bold" off (FALSE)
- Pict_Font.FontBold = 0
- Pict_Font.FontItalic = -1
- ' Clear picture box
- Pict_Font.Cls
- ' Display it
- Pict_Font.Print ; FaceName$
- End Sub
- Sub Opt_Norm_Click ()
- ' When Normal is chosen
- ' Set font attribute to Normal by setting Bold and Italic to FALSE(0)
- Pict_Font.FontBold = 0
- Pict_Font.FontItalic = 0
- ' Clear picture box
- Pict_Font.Cls
- ' Display it
- Pict_Font.Print ; FaceName$
- End Sub
-